/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.src.uniandes.ecos.tsp.creditscore.algorithm;

import com.src.uniandes.ecos.tsp.creditscore.exception.CreditScoreException;

/**
 *
 * @author djoya
 */
public class NewCredit {

    /**
     * constante 0.
     */
    private static final double ZERO = 0;

    /**
     * points new credit.
     * @param clientCode
     * @return total points new credit.
     * @throws CreditScoreException
     */
    public final double getPointsNewCredit(final Integer clientCode)
            throws CreditScoreException {

        double credInqPoints = ZERO;
        double creditCardPoints = ZERO;
        
        final RulesNewCredit rules = new RulesNewCredit();

        try{
            credInqPoints = rules.getPointsCreditInquiries(clientCode);
            creditCardPoints = rules.getPointsCreditCardProducts(clientCode);
        } catch (Exception e) {
           throw new CreditScoreException("NewCredit:getPointsNewCredit:"
                   + e.toString(),e);
        }

        return credInqPoints + creditCardPoints;
    }

}
